﻿#pragma once

#include <string>
#include <stdexcept>
#include "../stringhelper.h"

using namespace log4net;

namespace Server
{
    class MessageQueue
    {
    private:
        static MessageQueue *const instance;

    public:
        virtual ~MessageQueue()
        {
            delete MessageLog;
            delete DebugLog;
            delete ChatLog;
        }

        static MessageQueue *getInstance();

        ConcurrentQueue<std::string> *const MessageLog = new ConcurrentQueue<std::string>();
        ConcurrentQueue<std::string> *const DebugLog = new ConcurrentQueue<std::string>();
        ConcurrentQueue<std::string> *const ChatLog = new ConcurrentQueue<std::string>();

        MessageQueue();

        void Enqueue(const std::string &msg);

        void Enqueue(std::runtime_error ex);

        void EnqueueDebugging(const std::string &msg);

        void EnqueueChat(const std::string &msg);
    };
}
